import got from "got"
import {
  appid,
  secret,
  grant_type,
  wx_url_jscode2session,
} from "../utils/wechat.common.js"

class WechatService {
  async getWxtokenService({ js_code }) {
    let data = {
      js_code,
      appid,
      secret,
      grant_type,
    }
    const res = await got(wx_url_jscode2session, {
      searchParams: data,
    }).json()
    return res
  }
}

export default new WechatService()
